<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: zhouzixiong1
  Date: 2017/8/29
  Time: 16:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>后台用户注册</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="../../statics/css/bootstrap.min.css" rel="stylesheet">
    <link href="../../statics/css/style.css" rel="stylesheet">
    <link href="../../statics/css/ASignInNormalUser.css" rel="stylesheet">
    <link href="../../statics/css/ATopMenu.css" rel="stylesheet">
    <script src="../../statics/js/jquery-3.0.0.js"></script>
    <script src="../../statics/js/layer.js"></script>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="title aTopMenu">后台用户注册</div>
    </div>
    <div class="row">
        <c:import url="common/ATopMenu.jsp"></c:import>
    </div>
    <div class="row">
        <div class="col-sm-8 col-sm-push-2">
            <div class="col-sm-4 label">用户名：</div>
            <div class="col-sm-8">
                <input class="form-control" name="userName" id="userName" placeholder="请输入用户名">
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-8 col-sm-push-2">
            <div class="col-sm-4 label">密&nbsp;码：</div>
            <div class="col-sm-8">
                <input class="form-control" name="password" id="password" placeholder="请输入密码">
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-8 col-sm-push-2">
            <div class="col-sm-4 label">权&nbsp;限：</div>
            <div class="col-sm-8">
                <select class="form-control combobox" name="power" id="power">
                    <option value="-1">请选择</option>
                    <option value="0">最高权限</option>
                    <option value="1">管账</option>
                    <option value="2">雇员</option>
                    <option value="3">兼职</option>
                </select>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-8 col-sm-push-2" style="text-align: center">
            <button class="btn btn-info" name="signIn" id="signIn" onclick="signIn()">注册</button>
        </div>
    </div>
</div>
<script type="text/javascript">
    document.getElementById("MenuASignInAdminUser").className = "active";
    function signIn() {
        var signIn = {
            userName: $("#userName").val(),
            password: $("#password").val(),
            power: $("#power").val()
        };
        $.ajax({
            type:'post',
            url:'/AdminUser/adminUserSignIn',
            data: JSON.stringify(signIn),
            contentType: 'application/json',
            dataType:'json',
            success: function (data) {
                console.log(data.code);
                if(data.code=="0"){
                    layer.msg("用户注册成功：" + data.data);
                }else{
                    layer.msg(data.message);
                }
            }
        })
    }
</script>
</body>
</html>
